import { Router, type Router as ExpressRouter } from 'express';
import authRoutes from './auth';

const router: ExpressRouter = Router();

// API版本前缀
const API_VERSION = '/api/v1';

// 注册路由模块
router.use(`${API_VERSION}/auth`, authRoutes);

// 健康检查路由
router.get('/health', (_req, res) => {
  res.json({
    status: 'ok',
    timestamp: new Date().toISOString(),
    uptime: process.uptime(),
    environment: process.env.NODE_ENV || 'development'
  });
});

// API根路径
router.get(`${API_VERSION}`, (_req, res) => {
  res.json({
    message: '健身教练APP API',
    version: '1.0.0',
    endpoints: {
      auth: `${API_VERSION}/auth`,
      health: '/health'
    }
  });
});

export default router;